home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Info-Mac 3
/
Info_Mac_1994-01.iso
/
Development
/
Source
/
Morpion 1.0.0 Source
/
Morpion.p
< prev
next >
Wrap
Text File
|
1993-12-03
|
1KB
|
68 lines
program Morpion;
uses
MySystemGlobals, MyFMenus, MyOOMainLoop, {}
MyOOMenus, BaseGlobals, MyAppleEvents, MyDialogs, MyUtils, Game, MySpeak;
procedure HandleMainEvents;
var
b: boolean;
fw: windowPtr;
er: eventRecord;
begin
if SetOOMenuBar then
DrawMenuBar;
fw := FrontWindow;
b := GetWObject(fw).WaitForEvent(er, 10);
b := GetWObject(fw).HandleEvents(er);
end;
function DoQuit: OSErr;
begin
quitNow := true;
DoQuit := noErr;
end;
procedure DoMenuThing;
begin
end;
procedure SetMenuThing (themenu, theitem: integer);
begin
SetIDItemEnable(themenu, theitem, false);
end;
var
oe: OSErr;
dummy: boolean;
launched_with_option: boolean;
mainloop_dobj: DObject;
er: eventRecord;
begin
if Get1Resource('BNDL', 128) = nil then begin
SysBeep(1);
halt;
end;
dummy := GetOSEvent(0, er);
launched_with_option := BAND(er.modifiers, optionKey) <> 0;
InitSystemGlobals;
new(mainloop_dobj);
InitMainLoop(mainloop_dobj, @DoFMenu);
InitOOMenus(nil);
InitSpeak;
InitGame;
{ SetFBoth('sinf', @DoOpenInfo, @SetOpenInfo);}
if has_appleevents then
oe := InitAppleEvents(nil, nil, nil, @DoQuit);
UnloadSeg(@SegmentInit);
InitCursor;
while not quitNow do begin
HandleMainEvents;
end;
FinishGame;
FinishSpeak;
FinishOOmenus;
FinishMainLoop;
end.